Restriction to writing completely portable programs prevents the programmer from taking advantage of useful features specific to a single environment. For example the Macintosh ROM "Toolbox" provides many invaluable routines for writing Macintosh programs.
It is often possible to confine non-portable code to individual program modules to allow reuse of the remaining code in other environments. One way of isolating non-portable code is to define an abstract class from which machine-specific versions may be derived.
The files listed in the following pages implement the TC abstract Screen class for general-purpose 2-dimensional graphics combined with stdio-style output. The Mac_Screen class is derived from this class for use on the Macintosh, but C++ versions* for DOS or UNIX graphics-capable systems may readily be derived as well. This allows portable applications with simple graphics output.
TC's MacTraps library is required for applications using the Mac_Screen class. TC's precompiled header MacHeaders automatically declares the Toolbox functions.